<template>
  <div>
    <el-card>
      <el-table :data="tableData" style="width: 100%">
        <!-- <el-table-column prop="code" label="订单号" width="380">
        </el-table-column> -->
        <el-table-column prop="createTime" label="创建时间" width="250">
          <template #default="scope">
            {{ formDataMoment(scope.row.createTime) }}
          </template>
        </el-table-column>

        <el-table-column prop="editTime" label="修改时间">
          <template #default="scope">
            {{ formDataMoment(scope.row.editTime) }}
          </template>
        </el-table-column>
        <el-table-column prop="content" label="内容">
          <template #default="scope">
            {{ scope.row.content }}
          </template>
        </el-table-column>
        <!-- <el-table-column prop="useFlag" label="状态">
          <template #default="scope">
            {{ scope.row.useFlag ? "已使用" : "未使用" }}
          </template>
        </el-table-column> -->
       
      </el-table>
      <el-pagination
        background
        layout="prev, pager, next"
        :total="total"
        @current-change="handleCurrentChange"
        :page-size="10"
      />
    </el-card>
  </div>
</template>

<script setup>
import moment from "moment";
import {ref,reactive,onMounted,computed} from 'vue'
import axios from "axios"
const tableData = ref([])
const total = ref(0)
const params = {
    page:1
}
onMounted(() => {
    //console.log('222222')
    getTableList()
})
const getTableList = async () => {
    let res = await axios.get('/wxapi/notice/list',params)
    console.log('222222',res)
    if(res.data.code == 200) {
        
        tableData.value = res.data.data.result
        total.value = res.data.data.total
    }
}
const formDataMoment = (date) => {
  return moment(date).format("YYYY-MM-DD HH:mm:ss");
};
</script>

<style lang="scss" scoped>
.cover {
  width: 178px;
  height: 178px;
}
</style>